import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [{
    path: '/',
    redirect: '/login',
},

    {
        path: "/login",
        name: "login",
        component: () => import('../views/Login.vue')
    },
    {
        path: '/customer',
        name: 'customer',
        component: () => import('@/views/detailed/customer/index.vue'),
        redirect: '/shopping',
        children: [
            {
                //下单
                path: '/shopping',
                component: () => import('@/views/detailed/customer/shopping.vue'),
            },
            {
                //下单
                path: '/personal',
                component: () => import('@/views/detailed/customer/personal.vue'),
            },
        ]
    },
    {
        path: '/backLayout',
        name: 'backLayout',
        component: () => import('@/views/layout.vue'),
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/detailed/home.vue'),
            },
            {
                path: '/mana/ordersMana',
                component: () => import('@/views/detailed/ordersMana.vue'),
            },

            {
                path: '/mana/goodsMana',
                component: () => import('@/views/detailed/shopMana.vue'),
            },
            {

                path: '/mana/customerinfoMana',
                component: () => import('@/views/detailed/customerinfoMana.vue'),
            },
            {
                path: '/mana/categoryMana',
                component: () => import('@/views/detailed/categoryMana.vue'),
            },
            {
                path: '/mana/swiper',
                component: () => import('@/views/detailed/swiper.vue'),
            }

        ]
    },
    {
        path: ''
    }
];
const router = new VueRouter({
    mode: "hash",
    // base: process.env.BASE_URL,
    routes
});

export default router;